package com.totoro.mapper;

import com.totoro.pojo.Address;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author TOTORO
 * @date 2021/7/2 9:50
 * 收货地址操作映射
 */
@Repository
public interface AddressMapper {
    List<Address> findAddressByUid(@Param("uid") int uid);

    int addAddress(Address address);

    Address findAddressByAid(@Param("aid") int aid);

    int updateAddressNotDefaultByUidAndAid(@Param("uid") int uid, @Param("aid") int aid);

    int updateAddressIsDefaultByAid(@Param("aid") int aid);

    Integer getAddressLength();

    Integer updateAddressByAid(Address address);

    Integer deleteAddress(@Param("aid") int aid);
}
